package com.studentmanager.dto;

public class ResaultDto {
	
	
	
	//结果集的种类三类
	private boolean success;//相应成功还是失败的类型
	private String message;//成功或者失败所携带的信息
	private Object data;//携带的数据
	public ResaultDto(boolean success, String message, Object data) {
		super();
		this.success = success;
		this.message = message;
		this.data = data;
	}
	
	
	//成功的三种类型方法
	public static ResaultDto successResault(){
		return new ResaultDto(true,null,null);
	}
	public static ResaultDto successResault(String message){
		return new ResaultDto(true,message,null);
	} 
	public static ResaultDto successResault(String message,Object data){
		return new ResaultDto(true,message,data);
	}
	
	
	//失败的三种类型方法
	public static ResaultDto falseResault(){
		return new ResaultDto(false,null,null);
	}
	public static ResaultDto falseResault(String message){
		return new ResaultDto(false,message,null);
	} 
	public static ResaultDto falseResault(String message,Object data){
		return new ResaultDto(false,message,data);
	}
	
	//构造器
	public boolean isSuccess() {
		return success;
	}
	public String getMessage() {
		return message;
	}
	public Object getData() {
		return data;
	}
	
	
	//因为是结果对象，所以只要getter方法

	
}
